// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_c;

import com.nnee.p_k.cls_e;
import java.io.*;

// Referenced classes of package com.nnee.c:
//            k

public class cls_o
{

    public cls_o()
    {
    }

    public static void a(File file, String as[], cls_e e1)
    {
        if(e1 != null)
            if(as == null)
            {
                e1.a(0, 0L);
            } else
            {
                Thread thread = new Thread(new cls_k(as, file, e1));
                thread.setPriority(1);
                thread.start();
            }
    }

    public static boolean a(File file, int i)
    {
        boolean flag = true;
        if(file.exists())
        {
            String as[] = file.list();
            int j;
            if(as == null)
                j = 0;
            else
                j = as.length;
            if(i == j)
                flag = false;
        }
        return flag;
    }

    public static boolean a(String s, int i)
    {
        return a(new File(s), i);
    }

    public static boolean a(String s, boolean flag, String s1, byte abyte0[])
    {
        File file = new File(s);
        if(!file.exists())
			try {
				file.createNewFile();
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
        DataOutputStream dataoutputstream;
		try {
			dataoutputstream = new DataOutputStream(new FileOutputStream(file, flag));
		
        dataoutputstream.writeInt(4 + abyte0.length);
        
			dataoutputstream.writeInt(s1.hashCode());
		
        dataoutputstream.write(abyte0);
        dataoutputstream.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		
		}
        boolean flag1 = true;
 
        return flag1;
        
    }

    public static boolean a(String s, boolean flag, byte abyte0[])
    {
        File file = new File(s);
        if(!file.exists())
			try {
				file.createNewFile();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
        FileOutputStream fileoutputstream=null;
		try {
			fileoutputstream = new FileOutputStream(file, flag);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        try {
			fileoutputstream.write(abyte0);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        try {
			fileoutputstream.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        boolean flag1 = true;
 
        return flag1;
        
    }

    public static byte[] a(String s)
    {
    	byte abyte0[]= null;
        File file = new File(s);
        if(!file.exists()) {
        	abyte0 = null;
        }else {
        	FileInputStream fileinputstream=null;
			try {
				fileinputstream = new FileInputStream(file);
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            try {
				abyte0 = new byte[fileinputstream.available()];
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            try {
				fileinputstream.read(abyte0);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            try {
				fileinputstream.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
        }
        
        return abyte0;
 
    }

    public static byte[] a(String s, String s1, int i)
    {int j1;
    int k1;
    
    int j;
    int i1=0;
    	byte abyte0[]=null;
    	RandomAccessFile randomaccessfile = null;
        File file = new File(s);
        if(!file.exists()) {
        	abyte0 = null;
        } else {
        	try {
				randomaccessfile=new RandomAccessFile(file, "r");
			} catch (FileNotFoundException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
            
            j = s1.hashCode();
            for(int l = 0; l < i; l++)
				try {
					randomaccessfile.skipBytes(randomaccessfile.readInt());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

            try {
				i1 = randomaccessfile.readInt();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            try {
				if(randomaccessfile.readInt() != j || i1 < 4) {
					 if(randomaccessfile != null)
				         try
				         {
				             randomaccessfile.close();
				         }
				         catch(Exception exception5)
				         {
				             exception5.printStackTrace();
				         }
					 abyte0 = null;
				} else {
					 j1 = i1 + -4;
				     abyte0 = new byte[j1];
				     k1 = randomaccessfile.read(abyte0);
				     if(k1 != j1) {
				    	 if(randomaccessfile != null)
				             try
				             {
				                 randomaccessfile.close();
				             }
				             catch(Exception exception5)
				             {
				                 exception5.printStackTrace();
				             }
				    	 abyte0 = null;
				     }else {
				    	 if(randomaccessfile != null)
				             try
				             {
				                 randomaccessfile.close();
				             }
				             catch(Exception exception6)
				             {
				                 exception6.printStackTrace();
				             }
				     }
				}
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
        }
        
        return abyte0;
 
    }
}
